from django.db import models


# Create your models here.
class CarInformation(models.Model):
    id = models.AutoField('id', primary_key=True)  # 自增列 =int
    brand = models.CharField('品牌', max_length=255, default='')
    carName = models.CharField('车名', max_length=255, default='')
    carImg = models.CharField('图片链接', max_length=255, default='')
    saleVolume = models.CharField('销量', max_length=255, default='')
    price = models.CharField('价格', max_length=255, default='')
    manufacturer = models.CharField('厂商', max_length=255, default='')
    rank = models.CharField('排名', max_length=255, default='')
    carModel = models.CharField('车型', max_length=255, default='')
    energyType = models.CharField('能源类型', max_length=255, default='')
    marketTime = models.CharField('上市时间', max_length=255, default='')
    insure = models.CharField('保修时间', max_length=255, default='')
    # auto_now_add=True自动创建时间
    createTime = models.DateField('创建时间', auto_now_add=True)  # 日期类型 date   对于参数，auto_now = True 则每次更新都会更新这个时间；

    class Meta:
        db_table = 'carInfo'  # 创建表名
